<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>成绩</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
	<div class="container"> 
		<div id="ztc2pj" style="z-index: 999;">
			<p id="running" class="main">努力加载中 。。。</p>
			<table id="mytable">
			</table>
		</div>
	</div>
	<script>
		$(function() { 
			$('#ligrade').addClass("active");
			$.get("${pageContext.request.contextPath}/jwc/getScore.ztc", {},
					function(data) {
						if(data.totalCount==null){
							swal({
								title: "安全提示",
								text: "为了账户安全请输入验证码",
								imageUrl: "${pageContext.request.contextPath}/user/getYzm.ztc",
								type: "input",
								showCancelButton: true,
								closeOnConfirm: false,
								animation: "slide-from-top",
								inputPlaceholder: "请输入验证码！（验证码不用刷新）"
							},function(input){
								$.get("${pageContext.request.contextPath}/jwc/submitYzm.ztc",{yzm : input},
								function(data){
									if(data.result=="error"){
										swal.showInputError("验证码输入错误！请重新输入！");
										return false;
									}else{
										location.reload();
									}
								});
							});
						}
						var titleHeight = $('.ibox-title').height()+20;
						$('#running').show();
						$('#mytable').bootstrapTable({
							height : $(window).height() - 40,
							data : data.data,
							method : 'get',
							striped : true,
							cache : false,
							pagination : true,
							sortOrder : "asc",
							pageSize : 14,
							dataType : 'json',
							pageList : [ 10, 20, 50, 100 ],
							sidePagination : "client",
							search : true,
							rowStyle : function(row,index){ 
								if((index+1)%2==0)
									return {css:{'color' : '#3c1414'}};
								return {css:{'color' : '#3c1414','background-color':'rgb(126, 137, 148)'}};
							},
							columns : [ {
								field : "no",
								width : "5.5%",
								align : 'center',
								title : '序号',
								formatter : function(value, row, index) {
									return index + 1;
								}
							}, {
								field : 'kcmc',
								align : 'center',
								title : ' 课程名称 ',
							}, {
								field : 'jsxm',
								align : 'center',
								title : ' 教师名称 '
							}, {
								field : 'xq',
								align : 'center',
								title : ' 学期  '
							}, {
								field : 'xs',
								align : 'center',
								title : ' 学时  '
							}, {
								field : 'xf',
								align : 'center',
								title : ' 学分  '
							}, {
								field : 'pscj',
								align : 'center',
								title : ' 平时成绩  '
							}, {
								field : 'qmcj',
								align : 'center',
								title : ' 期末成绩  '
							}, {
								field : 'zpcj',
								align : 'center',
								title : ' 总评成绩  '
							}, {
								field : 'kcsx',
								align : 'center',
								title : ' 课程类型  '
							}, {
								field : 'pxcj',
								align : 'center',
								title : ' 评选时成绩  '
							} ]
						});
						$('#running').hide();
					});
		});
	</script>

</body>

</html>